const { merge } = require("webpack-merge");
const path = require("path");
const base = require("./webpack.base");

const { getBundleType } = require("./utils");

const suffix = getBundleType();

module.exports = merge(base, {
  mode: "production",
  // devtool: "source-map",
  devtool: false,
  entry: "./src/index" + suffix,
  externals: {
    react: {
      commonjs: "react",
      commonjs2: "react",
      amd: "react",
      root: "React",
    },
    "react-dom": {
      commonjs: "react-dom",
      commonjs2: "react-dom",
      amd: "react-dom",
      root: "ReactDOM",
    },
  },
});
